import 'dart:convert';

import 'package:enterprise_v6_app/app/core/core.dart';
import 'package:enterprise_v6_app/app/data/entities/application/execute_entity.dart';
import 'package:enterprise_v6_app/generated/json/base/json_field.dart';
import 'package:enterprise_v6_app/generated/json/operating_ledger_entity.g.dart';

export 'package:enterprise_v6_app/generated/json/operating_ledger_entity.g.dart';

@JsonSerializable()
class OperatingLedgerEntity {
  OperatingLedgerEntity();

  factory OperatingLedgerEntity.fromJson(Map<String, dynamic> json) => $OperatingLedgerEntityFromJson(json);
  String? applyUserName;
  String? departmentName;
  String? id;
  double? identity;
  String? involvedWorkName;
  String? planEndDate;
  String? planStartDate;
  String? processTypes;
  List<OperatingLedgerReceiptLists> receiptLists = [];
  String? ticketAddress;
  String? ticketContent;
  String? ticketName;
  String? ticketNo;
  String? ticketSource;
  RxBool? isShow = true.obs;

  Map<String, dynamic> toJson() => $OperatingLedgerEntityToJson(this);

  @override
  String toString() {
    return jsonEncode(this);
  }
}

@JsonSerializable()
class OperatingLedgerReceiptLists {
  OperatingLedgerReceiptLists();

  factory OperatingLedgerReceiptLists.fromJson(Map<String, dynamic> json) =>
      $OperatingLedgerReceiptListsFromJson(json);
  List<int>? abnormalType;
  String? applyUserId;
  String? applyUserName;
  String? endDate;
  String? guardianUserId;
  String? guardianUserName;
  String? id;
  double? look;
  String? otherTicketNo;
  String? planEndDate;
  String? planStartDate;
  String? startDate;
  String? ticketBigTypeName;
  String? ticketNo;
  String? ticketPlanId;
  double? type;

  /// 小票编号
  String? receiptNo = '';

  /// 人员列表
  List<ExecuteTicketReceiptListOperatorLists>? guardianList = [];

  Map<String, dynamic> toJson() => $OperatingLedgerReceiptListsToJson(this);

  @override
  String toString() {
    return jsonEncode(this);
  }
}
